import {searchmusic} from '../../network/http'
Page({
  data:{
  musicList:[]
  },
  TimeID:-1,
  onLoad(options){

  },
  Searchmusic(e){
    
    clearTimeout(this.TimeID);
    this.TimeID = setTimeout(() => {
        //4.准备发送请求获取数据
         this.Search(e.detail)
    }, 1500);
  },
 async Search(key){
    const {data:res}=await searchmusic(key)
    this.setData({
      musicList:res.result
    })
 }
 
})